-- GENERATED SPELL FOR [Elder Brightleaf] --


function spell0_32915(pUnit, Event) --@Brightleaf Flux,Self--
pUnit:FullCastSpellOnTarget(62262,pUnit)
pUnit:RegisterEvent('Sorts_32915', 0, 1)
end

function spell1_32915(pUnit, Event) --@Drained of Power,Self--
pUnit:FullCastSpellOnTarget(62467,pUnit)
pUnit:RegisterEvent('Sorts_32915', 557, 1)
end

function spell2_32915(pUnit, Event) --@Solar Flare,n/a--
pUnit:FullCastSpellOnTarget(62240,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32915', 0, 1)
end

function spell3_32915(pUnit, Event) --@Solar Flare,n/a--
pUnit:FullCastSpellOnTarget(64087,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32915', 0, 1)
end

function Sorts_32915(pUnit, Event)
local choix_sorts_32915 = math.random(0, 3)
if choix_sorts_32915 == 0 then
pUnit:RegisterEvent('spell0_32915', 1, 1)
end
if choix_sorts_32915 == 1 then
pUnit:RegisterEvent('spell1_32915', 1, 1)
end
if choix_sorts_32915 == 2 then
pUnit:RegisterEvent('spell2_32915', 1, 1)
end
if choix_sorts_32915 == 3 then
pUnit:RegisterEvent('spell3_32915', 1, 1)
end
end

function mob32915_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32915', math.random(1500, 3000), 1)
end

function mob32915_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32915_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32915_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32915, 1, 'mob32915_Action')
RegisterUnitEvent(32915, 2, 'mob32915_Leave')
RegisterUnitEvent(32915, 3, 'mob32915_Kill')
RegisterUnitEvent(32915, 4, 'mob32915_Die')
